const util = require('../../utils/util.js')

Page({
  data: {
    logs: [],
    loading: false
  },
  
  onLoad() {
    this.setData({
      loading: true
    })
    
    // 模拟获取日志数据
    setTimeout(() => {
      const logs = (wx.getStorageSync('logs') || []).map(log => {
        return {
          date: util.formatTime(new Date(log)),
          timeStamp: log
        }
      })
      
      this.setData({
        logs: logs,
        loading: false
      })
    }, 500)
  }
}) 